/**
 * 风险管理系统样式表
 */

:root {
    --primary-color: #4e73df;
    --secondary-color: #6c757d;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
    --border-radius: 0.375rem;
    --border-radius-sm: 0.25rem;
    --border-radius-lg: 0.5rem;
    --transition: all 0.3s ease;
}

/* 通用样式 */
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-color);
    color: #444;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5b86e5 100%);
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.rounded-3 {
    border-radius: var(--border-radius) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.w-100 {
    width: 100% !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.ms-3 {
    margin-left: 1rem !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.p-3 {
    padding: 1rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.p-5 {
    padding: 3rem !important;
}

.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.px-5 {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
}

.d-flex {
    display: flex !important;
}

.flex-shrink-0 {
    flex-shrink: 0 !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-lg-end {
    justify-content: flex-end !important;
}

.align-items-center {
    align-items: center !important;
}

.h-100 {
    height: 100% !important;
}

.border-0 {
    border: 0 !important;
}

.rounded-circle {
    border-radius: 50% !important;
}

.text-white {
    color: #fff !important;
}

.text-center {
    text-align: center !important;
}

.text-lg-end {
    text-align: right !important;
}

.text-muted {
    color: #6c757d !important;
}

/* 导航栏样式 */
.navbar {
    padding: 0.75rem 0;
    transition: var(--transition);
    background-color: #fff;
    box-shadow: var(--shadow-sm);
}

.navbar-scrolled {
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    margin: 0 0.25rem;
}

.nav-link:hover {
    background-color: rgba(0,0,0,0.04);
}

.nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(78, 115, 223, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #3a5ccc;
    border-color: #3a5ccc;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #17a673;
    border-color: #17a673;
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-warning:hover {
    background-color: #e8b925;
    border-color: #e8b925;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #d52a1a;
    border-color: #d52a1a;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-outline-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    color: #fff;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* 卡片样式 */
.card {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
    background-color: #fff;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: #6c757d;
}

/* 特殊卡片样式 */
.feature-card {
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* 图标样式 */
.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.stats-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

.bg-light {
    background-color: var(--light-color) !important;
}

.bg-dark {
    background-color: var(--dark-color) !important;
}

.bg-light-primary {
    background-color: rgba(78, 115, 223, 0.15);
    color: var(--primary-color);
}

.bg-light-success {
    background-color: rgba(28, 200, 138, 0.15);
    color: var(--success-color);
}

.bg-light-warning {
    background-color: rgba(246, 194, 62, 0.15);
    color: var(--warning-color);
}

.bg-light-danger {
    background-color: rgba(231, 74, 59, 0.15);
    color: var(--danger-color);
}

.bg-light-info {
    background-color: rgba(54, 185, 204, 0.15);
    color: var(--info-color);
}

/* 徽章样式 */
.badge {
    padding: 0.5em 0.6em;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
}

/* 页脚 */
.footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 2rem 0;
    margin-top: auto;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .text-lg-end {
        text-align: left !important;
    }
    
    .justify-content-lg-end {
        justify-content: flex-start !important;
    }
    
    .icon-circle {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1.25rem;
    }
    
    .icon-circle {
        width: 50px;
        height: 50px;
    }
    
    .stats-icon {
        width: 45px;
        height: 45px;
    }
}

/* FontAwesome兼容性修复 */
.fa-solid, .fas {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

.fa-regular, .far {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400;
}

.fa-brands, .fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400;
}

/* 确保旧式fa类还能正常使用 */
.fa {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    font-weight: normal;
    line-height: 1;
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
    font-weight: 900;
}

/* 仪表盘卡片样式 */
.card-dashboard {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-dashboard:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 统一边距和圆角 */
.card {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
    background-color: white;
}

/* 按钮美化 */
.btn {
    border-radius: 4px;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 自定义背景色 */
.bg-light-primary {
    background-color: rgba(0, 123, 255, 0.15);
    color: #007bff;
}

.bg-light-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.bg-light-success {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.bg-light-danger {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* 页面头部样式 */
.page-header {
    margin-bottom: 1.5rem;
}

/* 导航样式 */
.breadcrumb {
    background-color: transparent;
    padding-left: 0;
    padding-right: 0;
}

/* 表格样式 */
.table-hover tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
    cursor: pointer;
}

.table-hover-active {
    background-color: rgba(0, 123, 255, 0.05);
}

/* 风险表格特定样式 */
#riskTable th, #riskTable td {
    padding: 0.75rem;
    vertical-align: middle;
}

#riskTable th:nth-child(4),
#riskTable th:nth-child(5),
#riskTable th:nth-child(6),
#riskTable th:nth-child(7),
#riskTable th:nth-child(8) {
    width: 100px;
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    font-size: 85%;
    padding: 0.35em 0.65em;
}

/* 风险优先级标识 */
.priority-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.priority-1 { background-color: #e9ecef; } /* 很低 */
.priority-2 { background-color: #36b9cc; } /* 低 */
.priority-3 { background-color: #6c757d; } /* 中 */
.priority-4 { background-color: #f6c23e; } /* 高 */
.priority-5 { background-color: #e74a3b; } /* 很高 */

/* 响应式调整 */
@media (max-width: 768px) {
    .table-responsive {
        padding: 0;
    }
    
    #riskTable .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    #riskTable .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.25rem !important;
    }
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control:focus, .form-select:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
}

/* 搜索框样式 */
.search-input-group {
    position: relative;
}

.search-input-group .form-control {
    padding-left: 2.5rem;
    border-radius: 2rem;
    background-color: #f8f9fc;
}

.search-input-group .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #d1d3e2;
    z-index: 3;
}

/* 统计卡片样式 */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 工具提示样式定制 */
.tooltip-inner {
    max-width: 200px;
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.85);
}

/* 按钮样式增强 */
.btn {
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-icon-split {
    display: inline-flex;
    align-items: center;
}

.btn-icon-split .icon {
    background: rgba(0, 0, 0, 0.15);
    display: inline-block;
    padding: .375rem .75rem;
}

.btn-icon-split .text {
    display: inline-block;
    padding: .375rem .75rem;
} 